//
//  USTextView.h
//  usale0001
//
//  Created by wen on 16/12/5.
//  Copyright © 2016年 niusaibing. All rights reserved.
//

#import <UIKit/UIKit.h>

@class BDTextView;

@protocol BDTextViewDelegate <NSObject>

@optional
- (BOOL)bdTextViewShouldBeginEditing:(BDTextView *)textView;
- (BOOL)bdTextViewShouldEndEditing:(BDTextView *)textView;

- (void)bdTextViewDidBeginEditing:(BDTextView *)textView;
- (void)bdTextViewDidEndEditing:(BDTextView *)textView;

- (BOOL)bdTextView:(BDTextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
- (void)bdTextViewDidChange:(BDTextView *)textView;

- (void)bdTextViewDidChangeSelection:(BDTextView *)textView;

- (BOOL)bdTextView:(BDTextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction NS_AVAILABLE_IOS(10_0);
- (BOOL)bdTextView:(BDTextView *)textView shouldInteractWithTextAttachment:(NSTextAttachment *)textAttachment inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction NS_AVAILABLE_IOS(10_0);

@end

@interface BDTextView : UITextView

@property (nonatomic, strong) NSString *placeholder;
@property (nonatomic, strong) UIFont *placeHolderFont;
@property (nonatomic, weak) id<BDTextViewDelegate> textViewDelegate;

@end
